/*
 * Created on 24/02/2013 - 2:08 PM
 */
package sembr.vtk.data.input;

import vtk.vtkCubeSource;
import vtk.vtkPolyData;

/**
 *
 * @author adriano
 */
public class Cube extends SourceBase
{
    private vtkCubeSource cubeSource;
    private double[] bounds;
    
    public Cube(double bounds[])
    {
        setBounds(bounds);
        setCubeSource(new vtkCubeSource());
    }

    /**
     * @return the cubeSource
     */
    public vtkCubeSource getCubeSource() 
    {
        return cubeSource;
    }

    /**
     * @param cubeSource the cubeSource to set
     */
    private void setCubeSource(vtkCubeSource cubeSource) 
    {
        this.cubeSource = cubeSource;
        this.cubeSource.SetBounds(getBounds());
    }

    /**
     * @return the bounds
     */
    public double[] getBounds() 
    {
        return bounds;
    }

    /**
     * @param bounds the bounds to set
     */
    private void setBounds(double[] bounds) 
    {
        this.bounds = bounds;
    }

    @Override
    public vtkPolyData getPolyData() 
    {
        return getCubeSource().GetOutput();
    }
    
    
}
